package
{
	/**
	 * 
	 * @author Polar
	 * @date 2012-12-30
	 * @function 
	 * 
	 */
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.display3D.Context3D;
	import flash.events.Event;
	
	import starling.core.Starling;
	
	[SWF(width="480",height="800",frameRate="60",backgroundColor="#222222")]
	public class HelloStarling extends Sprite
	{
		private var _starling:Starling;
		public function HelloStarling()
		{
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			Starling.multitouchEnabled = true;
			Starling.handleLostContext = true;
			
			_starling  = new Starling(Game3,stage);
			_starling.antiAliasing = 1;
			
			_starling.simulateMultitouch = true;
			_starling.enableErrorChecking = false;
			
			_starling.showStats = true;
			_starling.start();
			_starling.stage3D.addEventListener(Event.CONTEXT3D_CREATE,onContextCreated);
		}
		private function onContextCreated(e:Event):void
		{
			var isHW:Boolean = Starling.context.driverInfo.toLowerCase().indexOf("software") > -1 ? false : true;
			if(!isHW)
				Starling.current.nativeStage.frameRate = 30;
		}
	}
}